<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Leaflet Rain Effect</title>
  <!-- 引入 Leaflet CSS 文件 -->
  <link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
  <!-- 引入 Leaflet JavaScript 文件 -->
  <script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
  <style>
      /* 设置地图容器的大小 */
      #map {
          height: 500px;
      }

      /* 雨滴样式 */
      .raindrop {
          position: absolute;
          width: 5px;
          height: 20px;
          background-color: blue;
          animation: fall linear infinite;
      }

      /* 雨滴动画 */
      @keyframes fall {
          to {
              transform: translateY(500px);
          }
      }
  </style>
</head>
<body>
<!-- 创建地图容器 -->
<div id="map"></div>

<script>
  // 创建 Leaflet 地图
  var map = L.map('map').setView([23.1791, 113.4644], 5);

  // 添加地图图层（这里使用 OpenStreetMap）
  L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
    attribution: '© OpenStreetMap contributors'
  }).addTo(map);

  // 添加模拟雨滴效果
  for (var i = 0; i < 100; i++) {
    var raindrop = document.createElement('div');
    raindrop.className = 'raindrop';
    raindrop.style.left = Math.random() * window.innerWidth + 'px';
    document.body.appendChild(raindrop);
  }
</script>
</body>
</html>
